package com.ruoyi.spspublic.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
//import com.ruoyi.common.core.domain.BasePartyEntity;
import com.ruoyi.common.utils.bean.ApplicationContextUtils;
import com.ruoyi.system.service.ISysUserService;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 任务列对象 t_mis_task
 *
 * @author ruoyi
 * @date 2023-08-18
 */
/*
@EqualsAndHashCode(callSuper = true)
*/
@Data
public class TMisTask /**extends BasePartyEntity**/ {
  private static final long serialVersionUID = 1L;

  /** 序号 */
  private String ctId;

  /** 任务名称 */
  @Excel(name = "任务名称")
  private String ctName;

  /** 发送人账号 */
  @Excel(name = "发送人账号")
  private String ctSendP;

  /** 接收人账号 */
  @Excel(name = "接收人账号")
  private String ctInceptP;

  /** 业务对应功能号 */
  @Excel(name = "业务对应功能号")
  private String ctFunNo;

  /** 业务单据编码 */
  @Excel(name = "业务单据编码")
  private String ctBussId;

  /** 单据发送日期 */
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
  @Excel(name = "单据发送日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
  private Date dtDateSend;

  /** 单据结束日期 */
  @JsonFormat(pattern = "yyyy-MM-dd")
  @Excel(name = "单据结束日期", width = 30, dateFormat = "yyyy-MM-dd")
  private Date dtDateEnd;

  /** 是否结束 1结束 */
  @Excel(name = "是否结束 1结束")
  private String ctFinish;

  /** 发送人姓名 */
  @Excel(name = "发送人姓名")
  private String ctSendName;

  /** 发送人部门 */
  @Excel(name = "发送人部门")
  private String ctCreateDept;

  /** 发送人隶属组织id */
  @Excel(name = "发送人隶属组织id")
  private String ctBranch;

  /** 任务类型 */
  @Excel(name = "任务类型")
  private String ctType;

  /** 接收类型 */
  @Excel(name = "接收类型")
  private String ctInceptType;

  /** 备注 */
  @Excel(name = "备注")
  private String ctMark;

  /** 备用1 */
  @Excel(name = "备用1")
  private String ctOther1;

  /** 备用2 */
  @Excel(name = "备用2")
  private String ctOther2;

  /** 备用3 */
  @Excel(name = "备用3")
  //0表示未发送通知，1表示已发送通知
  private String ctOther3;

  public TMisTask setForVisualization() {
    if ("1".equals(ctFinish)) {
      ctFinish = "已完成";
    } else {
      ctFinish = "未完成";
    }
    if (null == ctSendName || "".equals(ctSendName)) {
      if (null == ctSendP || "".equals(ctSendP)) {
        ctSendName = "未知发送人";
      } else {
        try {
          ctSendName = ApplicationContextUtils.getBean(ISysUserService.class).selectUserByUserName(ctSendP).getNickName();
        } catch (Exception e) {
          ctSendName = ctSendP;
        }
      }
    }
    //        ctType =
    // ApplicationContextUtils.getBean(ISysDictDataService.class).selectDictLabel("message_task",
    // this.ctType);
    return this;
  }
}
